<?php
namespace view;

class HTMLView {
    private $applicationModel;


    /**
    * __constructor
    */
    public function __construct()     {
        $this->applicationModel = new \model\ApplicationModel();
    }


	/**
    * @param string $userName
    * @return string HTML
    *
    * return -> hur den första delen på sidan ska se ut
    */
	public function returnHead($userName) {
        return "
        		 <!doctype html>
                    <head>
                        <title>The Opinion Blog</title>
                        <meta charset='utf-8'>
                        <link rel='Stylesheet' type='text/css'  href='style.css'/>
                        <link href='http://fonts.googleapis.com/css?family=Balthazar' rel='stylesheet' type='text/css'>
                    </head>
                    <body>
                        <div id='container'>
                        <div id='content'><h1>Welcome to the Opinion Blog ". $userName . "!</h1>";
    }


    /**
    * @return string HTML
    *
    * här avslutas html sidan
    */
    public function returnFooter() {

    	return "              </div>
                              </div>
    			     	</body>
    				</html>";
    }


  	/**
    * @return string HTML
    *
    * return -> visar medelar om att en ny användare är registrerad
    */
    public function returnSuccessfulNewUserPage() {
        return "<h2>Register of new user succseded!<h2>";
    }


    /**
	* @return string HTML
    *
    * return -> visar tillbaka knappen
	*/
    public function returnBackButton() {
        return "<div id='backbutton'><a href='?".$this->applicationModel->m_loginURL."'>Go back</a></div>";
    }


    /**
	* @return string HTML
    *
    * return -> visar OK knappen
    */
    public function returnOKButton() {
        return "<div id='okbutton'><a href='?".$this->applicationModel->m_loginURL."'>OK</a></div>";
    }


    /**
	* @return string HTML
    *
    * return -> visar Logga ut knappen
    */
    public function returnLogoutButton() {
        return "<div id='logout'><a href='?".$this->applicationModel->m_logoutURL."'>Log Out</a></div>";
    }


    /**
	* @return string HTML
    *
    * return -> visar länk knappen till add new post knappen
    */
    public function returnAddBlogButton() {
        return "<div id='addpostbutton'><a href='?".$this->applicationModel->m_addBlogPostURL."'>Add new blogpost</a></div>";
    }


    /**
	* @return string HTML
    *
    * return -> visar text "typ felmedelande"
    */
	public function returnUserMustBeLogedIn() {
        return "<h2>You must be loged in to be able to remove/comment/edit a post!</h2>";
    }


    /**
    * @return string HTML
    */
    public function returnHeadlineLogedIn() {
        return "<h2>Latest Blogposts</h2>";
    }


    /**
    * @return string HTML
    */
    public function returnHeadlineLogedOut() {
        return "<h2>Latest Blogposts</h2><h3>(Login to add blogpost/comment)</h3>";

    }


}

